<?php
class Crypt{
	
	
	function getKey(){
		return $_SERVER['SERVER_NAME'].'-bmxyb1BWL3p5NWtPTVFiT';
	}
	
	function encrypt($string){
		return base64_encode(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($this->getKey()), $string, MCRYPT_MODE_ECB, md5(md5($this->getKey())))));
	}
	
	function decrypt($string){
		return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($this->getKey()), base64_decode(base64_decode($string)), MCRYPT_MODE_ECB, md5(md5($this->getKey()))), "\0");
	}
	

}

?>
